<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="content"></div>
    <script>
        const students = [
            {
                name: "小米1",
                age: 18,
                sex: "男"
            },
            {
                name: "小米2",
                age: 18,
                sex: "男"
            },
            {
                name: "小米3",
                age: 18,
                sex: "男"
            }
        ]

        students.forEach(function(student){
                let str = `
                    <h2>
                        姓名：${student.name}
                    </h2>
                    <p>
                        年龄：${student.age}
                    </p>
                    <p>
                        性别：${student.sex}
                    </p>
            `;
            document.querySelector(".content").innerHTML += str;
        });

    </script>
</body>

</html>